package model;

import java.io.Serializable;
import javax.persistence.*;

/**
 * The primary key class for the TERRITORY_STATE database table.
 * 
 */
@Embeddable
public class TerritoryStatePK implements Serializable {
	//default serial version id, required for serializable classes.
	private static final long serialVersionUID = 1L;

	@Column(name="TERRITORY_ID")
	private long territoryId;

	@Column(name="\"STATE\"")
	private String state;

	public TerritoryStatePK() {
	}
	public long getTerritoryId() {
		return this.territoryId;
	}
	public void setTerritoryId(long territoryId) {
		this.territoryId = territoryId;
	}
	public String getState() {
		return this.state;
	}
	public void setState(String state) {
		this.state = state;
	}

	public boolean equals(Object other) {
		if (this == other) {
			return true;
		}
		if (!(other instanceof TerritoryStatePK)) {
			return false;
		}
		TerritoryStatePK castOther = (TerritoryStatePK)other;
		return 
			(this.territoryId == castOther.territoryId)
			&& this.state.equals(castOther.state);
	}

	public int hashCode() {
		final int prime = 31;
		int hash = 17;
		hash = hash * prime + ((int) (this.territoryId ^ (this.territoryId >>> 32)));
		hash = hash * prime + this.state.hashCode();
		
		return hash;
	}
}